package com.pshcp.common.enums;

/**
 * @Description: 支付类型 1微信 2支付宝 3云闪付
 * @Author: xiaoche
 * @Date: 2022/10/29 12:36
 */
public enum PayModeEnum {

    WECHAT_PAY(1, "微信"),

    ALI_PAY(2, "支付宝"),

    UNION_PAY(3, "云闪付"),

    ;

    private Integer code;
    private String desc;

    PayModeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDescByCode(int code){
        for(PayModeEnum e : PayModeEnum.values()){
            if(e.getCode().intValue() == code){
                return e.getDesc();
            }
        }
        return null;
    }

}
